﻿<Window x:Class="P2.Cuberry.Modules.SimpleAccounting.HRPayroll.HRPayrollFindPayrollCodeView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Height="389" Width="356"
        Title="Peacequare Cuberry"              
        Background="{DynamicResource P2BackgroundBrush}" >
                <Window.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/CuberryDataGrid.xaml"/>
            </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
    </Window.Resources>

    <Grid >
<Grid.Resources>
                <Image x:Key="FindIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.HRPayroll;component/Images/find16.gif" />
            <Image x:Key="RefreshIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.HRPayroll;component/Images/refresh16.gif" />

        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,0,0,0" Content="Find Account" Style="{StaticResource P2DetailViewHeaderTextStyle}" />

        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <StackPanel Orientation="Horizontal" >
                <TextBox Margin="3,2,1,0" Name="PayrollCodeNameOrNo" Height="23" Width="285" Text="{Binding PayrollCodeNameOrNo}" HorizontalAlignment="Left" Keyboard.KeyDown="Control_KeyDown"  VerticalAlignment="Top" Style="{StaticResource P2TextBoxStyle}"/>
                <Button Height="23" HorizontalAlignment="Right" Margin="3,2,1,0" Name="FindButton" Command="{Binding FiAccountFindCommand}"  VerticalAlignment="Top" Width="25">
                    <Image  Source="/P2.Cuberry.Modules.SimpleAccounting.HRPayroll;component/Images/find16.gif"></Image>
                </Button>
               

            </StackPanel>
        </Border>
        <!-- Row 1 End -->
        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid > 
                <DataGrid Grid.Row="2"  Margin="3,0,3,0" 
                             Name="HRPayrollCodeList"                                    
                             ItemsSource="{Binding FilteredAccounts}"
                             MouseDoubleClick="HRPayrollCodeList_MouseDoubleClick" 
                             KeyDown="HRPayrollCodeList_KeyDown"                             
                             Style="{DynamicResource CuberryDataGridStyle}"
                             VerticalAlignment="Top" >

                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{Translate PayrollCodeNoL}" IsReadOnly="True" Binding="{Binding Path=PayrollCodeNo, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"   Width="100" />
                        <DataGridTextColumn   Header="{Translate PayrollCodeNameL}" IsReadOnly="True"  Binding="{Binding PayrollCodeNameCur}" Width="*" MinWidth="40"/>

                    </DataGrid.Columns>
                </DataGrid> 
            </Grid>
        </Border>

    </Grid>
</Window>
